<?php echo $this->Form->create('Paginate', array('id' => 'paginate', 'url' => $this->request->here(false), 'type' => 'post', 'inputDefaults' => array('label' => false))); ?>                           
<div id="content-header">
    <h1><?php echo __d('system','Comments Management');?></h1>
</div>
<div id="breadcrumb">
    <a href="<?php echo $this->Html->url('/admin/')?>" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a>
    <a href="#" class="current"><?php echo __d('system','List Comments');?></a>
</div>
<div class="container-fluid">
<div class="row-fluid">
    <div class="span12">            
        <div class="widget-box">
            <div class="widget-title">
                <span class="icon">
                    <i class="icon-th"></i>
                </span>
                <h5><?php echo __d('system','List of Comments');?></h5>
            </div>
            <div class="widget-content widget-content-two">
                <div class="wd-select">
                    <div class="control-group">
                        <div class="controls wd-farming">
                            <select>
                                <option />
                            </select>
                            <button class="btn">Apply</button>
                        </div>
                    </div>
                </div>
                <table class="table table-bordered data-table table-striped with-check wd-hover-btn">
                    <thead>
                        <tr>                            
                            <th> <?php echo  __d('system', 'Email'); ?></th>
                            <th> <?php echo  __d('system', 'Comment'); ?></th>
                            <th> <?php echo  __d('system', 'Status'); ?></th>                                                
                            <th> <?php echo  __d('system', 'Created'); ?></th>                                                
                            <th> <?php echo  __d('system', 'Updated'); ?></th>                                                
                            <th class="wd-fix-width-2" style="min-width: 200px;"><?php echo  __d('system', 'Action'); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                            $defaultLanguage = Router::defaultLanguage();
                            $_queries = array('continue' => $this->request->here(false));
                        ?> 
                        <?php foreach ($comments as $comment) :?>                                            
                            <tr class="_comment_<?php echo $comment['Comment']['id'];?>">                                
                                <td>
                                    <a href="<?php echo $this->Html->url(array('plugin'=>'node','controller' => 'node', 'action' => 'edit',$comment['Comment']['id'], '?' => $_queries));?>"> <?php echo $comment['Comment']['email']; ?></a>
                                </td>                                                                                                                                         
                                <td>
                                    <a href="#"><?php echo $comment['Comment']['comment']; ?></a>
                                </td>                                                                                         
                                <td>
                                    <?php echo $comment['Comment']['status'];?>
                                </td>                        
                                <td>
                                    <?php echo date("d/m/Y",$comment['Comment']['created']);?>
                                </td>  
                                <td>
                                    <?php echo date("d/m/Y",$comment['Comment']['updated']);?>
                                </td>                                    
                                <td>
                                    <ul class="wd-link-control link-control-<?php echo $comment['Comment']['id'];?>">                                                                         
                                        <?php if($comment['Comment']['status']==1):?>                                        
                                            <li class="dis_approve_<?php echo $comment['Comment']['id']?>"><a href="#" onclick="set_status(<?php echo $comment['Comment']['id'];?>,0)" class="btn btn-mini"><i class="icon-edit"></i> <?php echo __d('system','Disapprove');?></a></li>
                                        <?php else:?>
                                            <li class="approve_<?php echo $comment['Comment']['id']?>"><a href="#" onclick="set_status(<?php echo $comment['Comment']['id'];?>,1)" class="btn btn-mini"><i class="icon-edit"></i> <?php echo __d('system','Approve');?></a></li>                                        
                                        <?php endif;?>                                        
                                        <li><a href="#" onclick="delete_comment(<?php echo $comment['Comment']['id']?>)" data-toggle="modal" class="btn btn-mini"><i class="icon-remove"></i> Delete</a></li>
                                    </ul>
                                </td>
                            </tr>
                            <div id="myAlert" class="modal hide">
                                <div class="modal-header">
                                    <button data-dismiss="modal" class="close" type="button">×</button>
                                    <h3>Alert</h3>
                                </div>
                                <div class="modal-body">
                                    <p>Are you sure delete “<?php echo $comment['Comment']['comment']?>”?</p>
                                </div>
                                <div class="modal-footer">
                                    <a data-dismiss="modal" class="btn" href="#">Cancel</a>
                                    <?php echo $this->Html->link('Delete', array('plugin'=>'node','controller' => 'node','action' => 'delete', '?' => array_merge($_queries, array('keys' => array($node['Node']['id'])))), array('title' => false, 'class' => 'btn btn-danger','data-dismiss='=>'modal')); ?>                        
                                </div>
                            </div>                                                       
                            <?php endforeach?>                        
                    </tbody>                    
                </table>
               
                <div class="wd-select">

                    <div class="control-group">
                        <div class="controls wd-farming">
                            <select>
                                <option />Delete
                            </select>
                            <button class="btn">Apply</button>
                        </div>
                    </div>
                </div>                                
            </div>
        </div>
    </div>    
</div>
<?php         
    echo $this->Form->hidden('task', array('id' => 'task', 'value' => ''));
    echo $this->Form->end();
?>